/*
 * Copyright 2007 Matt Jensen
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
 * the License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
 * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
 * specific language governing permissions and limitations under the License.
 */
package org.jtell;

import java.util.Map;

/**
 * <p>
 * <code>EventMetadata</code> defines the public interface to an event metadata object. Instances are attached to events
 * as they are distributed to registered event listeners, and provide access to the attributes of the event.
 * </p>
 */
public interface EventMetadata
{
    /**
     * <p>
     * Get a map containing all attribute names and values.
     * </p>
     *
     * @return {@link Map} of attribute names and values.
     */
    Map<String, String> getAllAttributes();

    /**
     * <p>
     * Get the value associated with a single event attribute.
     * </p>
     *
     * @param name the attribute name.
     * @return {@link String} attribute value or <code>null</code> if no value was applied to the attribute.
     */
    String getAttribute(String name);

    /**
     * <p>
     * Get the fully qualified name of the event class. Equivalent to calling {@link #getAttribute(String)} with
     * attribute name <code>event-class</code>..
     * </p>
     *
     * @return {@link String} event class name.
     */
    String getEventClassName();

    /**
     * <p>
     * Get the fully qualified name of the source class. Equivalent to calling {@link #getAttribute(String)} with
     * attribute name <code>source-class</code>..
     * </p>
     *
     * @return {@link String} source class name.
     */
    String getSourceClassName();
}
